package com.ecommerce.dal.entity;
// Generated May 3, 2013 3:35:49 PM by Hibernate Tools 3.6.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Rank generated by hbm2java
 */
@Entity
@Table(name = "rank", uniqueConstraints = @UniqueConstraint(columnNames = "RANK_NAME"))
public class Rank implements java.io.Serializable {

	private Integer rankId;
	private String rankName;
	private double paymentAmount;
	private String paymentPeriod;
	private Set<Client> clients = new HashSet<Client>(0);

	public Rank() {
	}

	public Rank(String rankName, double paymentAmount) {
		this.rankName = rankName;
		this.paymentAmount = paymentAmount;
	}

	public Rank(String rankName, double paymentAmount, String paymentPeriod,
			Set<Client> clients) {
		this.rankName = rankName;
		this.paymentAmount = paymentAmount;
		this.paymentPeriod = paymentPeriod;
		this.clients = clients;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "RANK_ID", unique = true, nullable = false)
	public Integer getRankId() {
		return this.rankId;
	}

	public void setRankId(Integer rankId) {
		this.rankId = rankId;
	}

	@Column(name = "RANK_NAME", unique = true, nullable = false, length = 15)
	public String getRankName() {
		return this.rankName;
	}

	public void setRankName(String rankName) {
		this.rankName = rankName;
	}

	@Column(name = "PAYMENT_AMOUNT", nullable = false, precision = 22, scale = 0)
	public double getPaymentAmount() {
		return this.paymentAmount;
	}

	public void setPaymentAmount(double paymentAmount) {
		this.paymentAmount = paymentAmount;
	}

	@Column(name = "PAYMENT_PERIOD", length = 45)
	public String getPaymentPeriod() {
		return this.paymentPeriod;
	}

	public void setPaymentPeriod(String paymentPeriod) {
		this.paymentPeriod = paymentPeriod;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "rank")
	public Set<Client> getClients() {
		return this.clients;
	}

	public void setClients(Set<Client> clients) {
		this.clients = clients;
	}

}
